{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 26,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "import os\n",
    "import pandas as pd\n",
    "import gc\n",
    "from multiprocessing import Pool, cpu_count\n",
    "from glob import glob\n",
    "from gplearn.genetic import SymbolicTransformer\n",
    "import utils"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "100%|██████████| 20/20 [00:02<00:00,  8.27it/s]\n",
      "100%|██████████| 20/20 [00:03<00:00,  5.92it/s]\n"
     ]
    }
   ],
   "source": [
    "bureau = utils.get_dummies(utils.read_pickles('../data/bureau').sort_values('SK_ID_CURR'))\n",
    "label = utils.load_train(['SK_ID_CURR', 'TARGET'])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "bureau = pd.merge(bureau, label, on='SK_ID_CURR', how='left')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "bureau = bureau[~bureau.TARGET.isnull()]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>SK_ID_CURR</th>\n",
       "      <th>SK_ID_BUREAU</th>\n",
       "      <th>DAYS_CREDIT</th>\n",
       "      <th>CREDIT_DAY_OVERDUE</th>\n",
       "      <th>DAYS_CREDIT_ENDDATE</th>\n",
       "      <th>DAYS_ENDDATE_FACT</th>\n",
       "      <th>AMT_CREDIT_MAX_OVERDUE</th>\n",
       "      <th>CNT_CREDIT_PROLONG</th>\n",
       "      <th>AMT_CREDIT_SUM</th>\n",
       "      <th>AMT_CREDIT_SUM_DEBT</th>\n",
       "      <th>...</th>\n",
       "      <th>CREDIT_TYPE_Loan-for-purchase-of-shares-(margin-lending)</th>\n",
       "      <th>CREDIT_TYPE_Loan-for-the-purchase-of-equipment</th>\n",
       "      <th>CREDIT_TYPE_Loan-for-working-capital-replenishment</th>\n",
       "      <th>CREDIT_TYPE_Microloan</th>\n",
       "      <th>CREDIT_TYPE_Mobile-operator-loan</th>\n",
       "      <th>CREDIT_TYPE_Mortgage</th>\n",
       "      <th>CREDIT_TYPE_Real-estate-loan</th>\n",
       "      <th>CREDIT_TYPE_Unknown-type-of-loan</th>\n",
       "      <th>TARGET</th>\n",
       "      <th>TARGET_norm</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>100002</td>\n",
       "      <td>6158909</td>\n",
       "      <td>-103</td>\n",
       "      <td>0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>40.500</td>\n",
       "      <td>0</td>\n",
       "      <td>31988.565</td>\n",
       "      <td>0.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.125</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>100002</td>\n",
       "      <td>6158908</td>\n",
       "      <td>-645</td>\n",
       "      <td>0</td>\n",
       "      <td>85.0</td>\n",
       "      <td>-36.0</td>\n",
       "      <td>5043.645</td>\n",
       "      <td>0</td>\n",
       "      <td>120735.000</td>\n",
       "      <td>0.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.125</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>100002</td>\n",
       "      <td>6158907</td>\n",
       "      <td>-1121</td>\n",
       "      <td>0</td>\n",
       "      <td>-911.0</td>\n",
       "      <td>-911.0</td>\n",
       "      <td>3321.000</td>\n",
       "      <td>0</td>\n",
       "      <td>19071.000</td>\n",
       "      <td>NaN</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.125</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>100002</td>\n",
       "      <td>6158906</td>\n",
       "      <td>-1437</td>\n",
       "      <td>0</td>\n",
       "      <td>-1072.0</td>\n",
       "      <td>-1185.0</td>\n",
       "      <td>0.000</td>\n",
       "      <td>0</td>\n",
       "      <td>135000.000</td>\n",
       "      <td>0.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.125</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>100002</td>\n",
       "      <td>6158905</td>\n",
       "      <td>-476</td>\n",
       "      <td>0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>-48.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0</td>\n",
       "      <td>0.000</td>\n",
       "      <td>0.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.125</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>100002</td>\n",
       "      <td>6158904</td>\n",
       "      <td>-1125</td>\n",
       "      <td>0</td>\n",
       "      <td>-1038.0</td>\n",
       "      <td>-1038.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0</td>\n",
       "      <td>40761.000</td>\n",
       "      <td>NaN</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.125</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>100002</td>\n",
       "      <td>6158903</td>\n",
       "      <td>-1042</td>\n",
       "      <td>0</td>\n",
       "      <td>780.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0</td>\n",
       "      <td>450000.000</td>\n",
       "      <td>245781.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.125</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>14</th>\n",
       "      <td>100002</td>\n",
       "      <td>6113835</td>\n",
       "      <td>-1043</td>\n",
       "      <td>0</td>\n",
       "      <td>62.0</td>\n",
       "      <td>-967.0</td>\n",
       "      <td>0.000</td>\n",
       "      <td>0</td>\n",
       "      <td>67500.000</td>\n",
       "      <td>NaN</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.125</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15</th>\n",
       "      <td>100003</td>\n",
       "      <td>5885880</td>\n",
       "      <td>-606</td>\n",
       "      <td>0</td>\n",
       "      <td>1216.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.000</td>\n",
       "      <td>0</td>\n",
       "      <td>810000.000</td>\n",
       "      <td>0.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>16</th>\n",
       "      <td>100003</td>\n",
       "      <td>5885879</td>\n",
       "      <td>-775</td>\n",
       "      <td>0</td>\n",
       "      <td>-420.0</td>\n",
       "      <td>-621.0</td>\n",
       "      <td>0.000</td>\n",
       "      <td>0</td>\n",
       "      <td>72652.500</td>\n",
       "      <td>0.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>17</th>\n",
       "      <td>100003</td>\n",
       "      <td>5885878</td>\n",
       "      <td>-1636</td>\n",
       "      <td>0</td>\n",
       "      <td>-540.0</td>\n",
       "      <td>-540.0</td>\n",
       "      <td>0.000</td>\n",
       "      <td>0</td>\n",
       "      <td>112500.000</td>\n",
       "      <td>0.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>18</th>\n",
       "      <td>100003</td>\n",
       "      <td>5885877</td>\n",
       "      <td>-2586</td>\n",
       "      <td>0</td>\n",
       "      <td>-2434.0</td>\n",
       "      <td>-2131.0</td>\n",
       "      <td>0.000</td>\n",
       "      <td>0</td>\n",
       "      <td>22248.000</td>\n",
       "      <td>0.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>19</th>\n",
       "      <td>100004</td>\n",
       "      <td>6829133</td>\n",
       "      <td>-1326</td>\n",
       "      <td>0</td>\n",
       "      <td>-595.0</td>\n",
       "      <td>-683.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0</td>\n",
       "      <td>94500.000</td>\n",
       "      <td>0.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20</th>\n",
       "      <td>100004</td>\n",
       "      <td>6829134</td>\n",
       "      <td>-408</td>\n",
       "      <td>0</td>\n",
       "      <td>-382.0</td>\n",
       "      <td>-382.0</td>\n",
       "      <td>0.000</td>\n",
       "      <td>0</td>\n",
       "      <td>94537.800</td>\n",
       "      <td>0.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24</th>\n",
       "      <td>100007</td>\n",
       "      <td>5987200</td>\n",
       "      <td>-1149</td>\n",
       "      <td>0</td>\n",
       "      <td>-783.0</td>\n",
       "      <td>-783.0</td>\n",
       "      <td>0.000</td>\n",
       "      <td>0</td>\n",
       "      <td>146250.000</td>\n",
       "      <td>0.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>25</th>\n",
       "      <td>100008</td>\n",
       "      <td>6491434</td>\n",
       "      <td>-78</td>\n",
       "      <td>0</td>\n",
       "      <td>471.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.000</td>\n",
       "      <td>0</td>\n",
       "      <td>267606.000</td>\n",
       "      <td>240057.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>26</th>\n",
       "      <td>100008</td>\n",
       "      <td>6491432</td>\n",
       "      <td>-1097</td>\n",
       "      <td>0</td>\n",
       "      <td>-792.0</td>\n",
       "      <td>-790.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0</td>\n",
       "      <td>95134.500</td>\n",
       "      <td>0.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>27</th>\n",
       "      <td>100008</td>\n",
       "      <td>6491433</td>\n",
       "      <td>-1097</td>\n",
       "      <td>0</td>\n",
       "      <td>-853.0</td>\n",
       "      <td>-1028.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0</td>\n",
       "      <td>105705.000</td>\n",
       "      <td>0.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>28</th>\n",
       "      <td>100009</td>\n",
       "      <td>5651008</td>\n",
       "      <td>-1259</td>\n",
       "      <td>0</td>\n",
       "      <td>-1080.0</td>\n",
       "      <td>-986.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0</td>\n",
       "      <td>114799.500</td>\n",
       "      <td>NaN</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>29</th>\n",
       "      <td>100009</td>\n",
       "      <td>5651014</td>\n",
       "      <td>-727</td>\n",
       "      <td>0</td>\n",
       "      <td>-482.0</td>\n",
       "      <td>-482.0</td>\n",
       "      <td>0.000</td>\n",
       "      <td>0</td>\n",
       "      <td>110655.000</td>\n",
       "      <td>0.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.000</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>20 rows × 39 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "    SK_ID_CURR  SK_ID_BUREAU  DAYS_CREDIT  CREDIT_DAY_OVERDUE  \\\n",
       "7       100002       6158909         -103                   0   \n",
       "8       100002       6158908         -645                   0   \n",
       "9       100002       6158907        -1121                   0   \n",
       "10      100002       6158906        -1437                   0   \n",
       "11      100002       6158905         -476                   0   \n",
       "12      100002       6158904        -1125                   0   \n",
       "13      100002       6158903        -1042                   0   \n",
       "14      100002       6113835        -1043                   0   \n",
       "15      100003       5885880         -606                   0   \n",
       "16      100003       5885879         -775                   0   \n",
       "17      100003       5885878        -1636                   0   \n",
       "18      100003       5885877        -2586                   0   \n",
       "19      100004       6829133        -1326                   0   \n",
       "20      100004       6829134         -408                   0   \n",
       "24      100007       5987200        -1149                   0   \n",
       "25      100008       6491434          -78                   0   \n",
       "26      100008       6491432        -1097                   0   \n",
       "27      100008       6491433        -1097                   0   \n",
       "28      100009       5651008        -1259                   0   \n",
       "29      100009       5651014         -727                   0   \n",
       "\n",
       "    DAYS_CREDIT_ENDDATE  DAYS_ENDDATE_FACT  AMT_CREDIT_MAX_OVERDUE  \\\n",
       "7                   NaN                NaN                  40.500   \n",
       "8                  85.0              -36.0                5043.645   \n",
       "9                -911.0             -911.0                3321.000   \n",
       "10              -1072.0            -1185.0                   0.000   \n",
       "11                  NaN              -48.0                     NaN   \n",
       "12              -1038.0            -1038.0                     NaN   \n",
       "13                780.0                NaN                     NaN   \n",
       "14                 62.0             -967.0                   0.000   \n",
       "15               1216.0                NaN                   0.000   \n",
       "16               -420.0             -621.0                   0.000   \n",
       "17               -540.0             -540.0                   0.000   \n",
       "18              -2434.0            -2131.0                   0.000   \n",
       "19               -595.0             -683.0                     NaN   \n",
       "20               -382.0             -382.0                   0.000   \n",
       "24               -783.0             -783.0                   0.000   \n",
       "25                471.0                NaN                   0.000   \n",
       "26               -792.0             -790.0                     NaN   \n",
       "27               -853.0            -1028.0                     NaN   \n",
       "28              -1080.0             -986.0                     NaN   \n",
       "29               -482.0             -482.0                   0.000   \n",
       "\n",
       "    CNT_CREDIT_PROLONG  AMT_CREDIT_SUM  AMT_CREDIT_SUM_DEBT     ...       \\\n",
       "7                    0       31988.565                  0.0     ...        \n",
       "8                    0      120735.000                  0.0     ...        \n",
       "9                    0       19071.000                  NaN     ...        \n",
       "10                   0      135000.000                  0.0     ...        \n",
       "11                   0           0.000                  0.0     ...        \n",
       "12                   0       40761.000                  NaN     ...        \n",
       "13                   0      450000.000             245781.0     ...        \n",
       "14                   0       67500.000                  NaN     ...        \n",
       "15                   0      810000.000                  0.0     ...        \n",
       "16                   0       72652.500                  0.0     ...        \n",
       "17                   0      112500.000                  0.0     ...        \n",
       "18                   0       22248.000                  0.0     ...        \n",
       "19                   0       94500.000                  0.0     ...        \n",
       "20                   0       94537.800                  0.0     ...        \n",
       "24                   0      146250.000                  0.0     ...        \n",
       "25                   0      267606.000             240057.0     ...        \n",
       "26                   0       95134.500                  0.0     ...        \n",
       "27                   0      105705.000                  0.0     ...        \n",
       "28                   0      114799.500                  NaN     ...        \n",
       "29                   0      110655.000                  0.0     ...        \n",
       "\n",
       "    CREDIT_TYPE_Loan-for-purchase-of-shares-(margin-lending)  \\\n",
       "7                                                   0          \n",
       "8                                                   0          \n",
       "9                                                   0          \n",
       "10                                                  0          \n",
       "11                                                  0          \n",
       "12                                                  0          \n",
       "13                                                  0          \n",
       "14                                                  0          \n",
       "15                                                  0          \n",
       "16                                                  0          \n",
       "17                                                  0          \n",
       "18                                                  0          \n",
       "19                                                  0          \n",
       "20                                                  0          \n",
       "24                                                  0          \n",
       "25                                                  0          \n",
       "26                                                  0          \n",
       "27                                                  0          \n",
       "28                                                  0          \n",
       "29                                                  0          \n",
       "\n",
       "    CREDIT_TYPE_Loan-for-the-purchase-of-equipment  \\\n",
       "7                                                0   \n",
       "8                                                0   \n",
       "9                                                0   \n",
       "10                                               0   \n",
       "11                                               0   \n",
       "12                                               0   \n",
       "13                                               0   \n",
       "14                                               0   \n",
       "15                                               0   \n",
       "16                                               0   \n",
       "17                                               0   \n",
       "18                                               0   \n",
       "19                                               0   \n",
       "20                                               0   \n",
       "24                                               0   \n",
       "25                                               0   \n",
       "26                                               0   \n",
       "27                                               0   \n",
       "28                                               0   \n",
       "29                                               0   \n",
       "\n",
       "    CREDIT_TYPE_Loan-for-working-capital-replenishment  CREDIT_TYPE_Microloan  \\\n",
       "7                                                   0                       0   \n",
       "8                                                   0                       0   \n",
       "9                                                   0                       0   \n",
       "10                                                  0                       0   \n",
       "11                                                  0                       0   \n",
       "12                                                  0                       0   \n",
       "13                                                  0                       0   \n",
       "14                                                  0                       0   \n",
       "15                                                  0                       0   \n",
       "16                                                  0                       0   \n",
       "17                                                  0                       0   \n",
       "18                                                  0                       0   \n",
       "19                                                  0                       0   \n",
       "20                                                  0                       0   \n",
       "24                                                  0                       0   \n",
       "25                                                  0                       0   \n",
       "26                                                  0                       0   \n",
       "27                                                  0                       0   \n",
       "28                                                  0                       0   \n",
       "29                                                  0                       0   \n",
       "\n",
       "    CREDIT_TYPE_Mobile-operator-loan  CREDIT_TYPE_Mortgage  \\\n",
       "7                                  0                     0   \n",
       "8                                  0                     0   \n",
       "9                                  0                     0   \n",
       "10                                 0                     0   \n",
       "11                                 0                     0   \n",
       "12                                 0                     0   \n",
       "13                                 0                     0   \n",
       "14                                 0                     0   \n",
       "15                                 0                     0   \n",
       "16                                 0                     0   \n",
       "17                                 0                     0   \n",
       "18                                 0                     0   \n",
       "19                                 0                     0   \n",
       "20                                 0                     0   \n",
       "24                                 0                     0   \n",
       "25                                 0                     0   \n",
       "26                                 0                     0   \n",
       "27                                 0                     0   \n",
       "28                                 0                     0   \n",
       "29                                 0                     0   \n",
       "\n",
       "    CREDIT_TYPE_Real-estate-loan  CREDIT_TYPE_Unknown-type-of-loan  TARGET  \\\n",
       "7                              0                                 0     1.0   \n",
       "8                              0                                 0     1.0   \n",
       "9                              0                                 0     1.0   \n",
       "10                             0                                 0     1.0   \n",
       "11                             0                                 0     1.0   \n",
       "12                             0                                 0     1.0   \n",
       "13                             0                                 0     1.0   \n",
       "14                             0                                 0     1.0   \n",
       "15                             0                                 0     0.0   \n",
       "16                             0                                 0     0.0   \n",
       "17                             0                                 0     0.0   \n",
       "18                             0                                 0     0.0   \n",
       "19                             0                                 0     0.0   \n",
       "20                             0                                 0     0.0   \n",
       "24                             0                                 0     0.0   \n",
       "25                             0                                 0     0.0   \n",
       "26                             0                                 0     0.0   \n",
       "27                             0                                 0     0.0   \n",
       "28                             0                                 0     0.0   \n",
       "29                             0                                 0     0.0   \n",
       "\n",
       "    TARGET_norm  \n",
       "7         0.125  \n",
       "8         0.125  \n",
       "9         0.125  \n",
       "10        0.125  \n",
       "11        0.125  \n",
       "12        0.125  \n",
       "13        0.125  \n",
       "14        0.125  \n",
       "15        0.000  \n",
       "16        0.000  \n",
       "17        0.000  \n",
       "18        0.000  \n",
       "19        0.000  \n",
       "20        0.000  \n",
       "24        0.000  \n",
       "25        0.000  \n",
       "26        0.000  \n",
       "27        0.000  \n",
       "28        0.000  \n",
       "29        0.000  \n",
       "\n",
       "[20 rows x 39 columns]"
      ]
     },
     "execution_count": 18,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "bureau.head(20)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [],
   "source": [
    "bureau['TARGET_norm'] = bureau.TARGET / bureau.groupby('SK_ID_CURR')['SK_ID_CURR'].transform('count')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>SK_ID_CURR</th>\n",
       "      <th>SK_ID_BUREAU</th>\n",
       "      <th>DAYS_CREDIT</th>\n",
       "      <th>CREDIT_DAY_OVERDUE</th>\n",
       "      <th>DAYS_CREDIT_ENDDATE</th>\n",
       "      <th>DAYS_ENDDATE_FACT</th>\n",
       "      <th>AMT_CREDIT_MAX_OVERDUE</th>\n",
       "      <th>CNT_CREDIT_PROLONG</th>\n",
       "      <th>AMT_CREDIT_SUM</th>\n",
       "      <th>AMT_CREDIT_SUM_DEBT</th>\n",
       "      <th>...</th>\n",
       "      <th>CREDIT_TYPE_Loan-for-purchase-of-shares-(margin-lending)</th>\n",
       "      <th>CREDIT_TYPE_Loan-for-the-purchase-of-equipment</th>\n",
       "      <th>CREDIT_TYPE_Loan-for-working-capital-replenishment</th>\n",
       "      <th>CREDIT_TYPE_Microloan</th>\n",
       "      <th>CREDIT_TYPE_Mobile-operator-loan</th>\n",
       "      <th>CREDIT_TYPE_Mortgage</th>\n",
       "      <th>CREDIT_TYPE_Real-estate-loan</th>\n",
       "      <th>CREDIT_TYPE_Unknown-type-of-loan</th>\n",
       "      <th>TARGET</th>\n",
       "      <th>TARGET_norm</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>100002</td>\n",
       "      <td>6158909</td>\n",
       "      <td>-103</td>\n",
       "      <td>0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>40.500</td>\n",
       "      <td>0</td>\n",
       "      <td>31988.565</td>\n",
       "      <td>0.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.125</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>100002</td>\n",
       "      <td>6158908</td>\n",
       "      <td>-645</td>\n",
       "      <td>0</td>\n",
       "      <td>85.0</td>\n",
       "      <td>-36.0</td>\n",
       "      <td>5043.645</td>\n",
       "      <td>0</td>\n",
       "      <td>120735.000</td>\n",
       "      <td>0.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.125</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>100002</td>\n",
       "      <td>6158907</td>\n",
       "      <td>-1121</td>\n",
       "      <td>0</td>\n",
       "      <td>-911.0</td>\n",
       "      <td>-911.0</td>\n",
       "      <td>3321.000</td>\n",
       "      <td>0</td>\n",
       "      <td>19071.000</td>\n",
       "      <td>NaN</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.125</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>100002</td>\n",
       "      <td>6158906</td>\n",
       "      <td>-1437</td>\n",
       "      <td>0</td>\n",
       "      <td>-1072.0</td>\n",
       "      <td>-1185.0</td>\n",
       "      <td>0.000</td>\n",
       "      <td>0</td>\n",
       "      <td>135000.000</td>\n",
       "      <td>0.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.125</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>100002</td>\n",
       "      <td>6158905</td>\n",
       "      <td>-476</td>\n",
       "      <td>0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>-48.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0</td>\n",
       "      <td>0.000</td>\n",
       "      <td>0.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.125</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>100002</td>\n",
       "      <td>6158904</td>\n",
       "      <td>-1125</td>\n",
       "      <td>0</td>\n",
       "      <td>-1038.0</td>\n",
       "      <td>-1038.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0</td>\n",
       "      <td>40761.000</td>\n",
       "      <td>NaN</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.125</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>100002</td>\n",
       "      <td>6158903</td>\n",
       "      <td>-1042</td>\n",
       "      <td>0</td>\n",
       "      <td>780.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0</td>\n",
       "      <td>450000.000</td>\n",
       "      <td>245781.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.125</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>14</th>\n",
       "      <td>100002</td>\n",
       "      <td>6113835</td>\n",
       "      <td>-1043</td>\n",
       "      <td>0</td>\n",
       "      <td>62.0</td>\n",
       "      <td>-967.0</td>\n",
       "      <td>0.000</td>\n",
       "      <td>0</td>\n",
       "      <td>67500.000</td>\n",
       "      <td>NaN</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.125</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15</th>\n",
       "      <td>100003</td>\n",
       "      <td>5885880</td>\n",
       "      <td>-606</td>\n",
       "      <td>0</td>\n",
       "      <td>1216.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.000</td>\n",
       "      <td>0</td>\n",
       "      <td>810000.000</td>\n",
       "      <td>0.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>16</th>\n",
       "      <td>100003</td>\n",
       "      <td>5885879</td>\n",
       "      <td>-775</td>\n",
       "      <td>0</td>\n",
       "      <td>-420.0</td>\n",
       "      <td>-621.0</td>\n",
       "      <td>0.000</td>\n",
       "      <td>0</td>\n",
       "      <td>72652.500</td>\n",
       "      <td>0.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>17</th>\n",
       "      <td>100003</td>\n",
       "      <td>5885878</td>\n",
       "      <td>-1636</td>\n",
       "      <td>0</td>\n",
       "      <td>-540.0</td>\n",
       "      <td>-540.0</td>\n",
       "      <td>0.000</td>\n",
       "      <td>0</td>\n",
       "      <td>112500.000</td>\n",
       "      <td>0.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>18</th>\n",
       "      <td>100003</td>\n",
       "      <td>5885877</td>\n",
       "      <td>-2586</td>\n",
       "      <td>0</td>\n",
       "      <td>-2434.0</td>\n",
       "      <td>-2131.0</td>\n",
       "      <td>0.000</td>\n",
       "      <td>0</td>\n",
       "      <td>22248.000</td>\n",
       "      <td>0.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>19</th>\n",
       "      <td>100004</td>\n",
       "      <td>6829133</td>\n",
       "      <td>-1326</td>\n",
       "      <td>0</td>\n",
       "      <td>-595.0</td>\n",
       "      <td>-683.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0</td>\n",
       "      <td>94500.000</td>\n",
       "      <td>0.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20</th>\n",
       "      <td>100004</td>\n",
       "      <td>6829134</td>\n",
       "      <td>-408</td>\n",
       "      <td>0</td>\n",
       "      <td>-382.0</td>\n",
       "      <td>-382.0</td>\n",
       "      <td>0.000</td>\n",
       "      <td>0</td>\n",
       "      <td>94537.800</td>\n",
       "      <td>0.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24</th>\n",
       "      <td>100007</td>\n",
       "      <td>5987200</td>\n",
       "      <td>-1149</td>\n",
       "      <td>0</td>\n",
       "      <td>-783.0</td>\n",
       "      <td>-783.0</td>\n",
       "      <td>0.000</td>\n",
       "      <td>0</td>\n",
       "      <td>146250.000</td>\n",
       "      <td>0.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>25</th>\n",
       "      <td>100008</td>\n",
       "      <td>6491434</td>\n",
       "      <td>-78</td>\n",
       "      <td>0</td>\n",
       "      <td>471.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.000</td>\n",
       "      <td>0</td>\n",
       "      <td>267606.000</td>\n",
       "      <td>240057.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>26</th>\n",
       "      <td>100008</td>\n",
       "      <td>6491432</td>\n",
       "      <td>-1097</td>\n",
       "      <td>0</td>\n",
       "      <td>-792.0</td>\n",
       "      <td>-790.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0</td>\n",
       "      <td>95134.500</td>\n",
       "      <td>0.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>27</th>\n",
       "      <td>100008</td>\n",
       "      <td>6491433</td>\n",
       "      <td>-1097</td>\n",
       "      <td>0</td>\n",
       "      <td>-853.0</td>\n",
       "      <td>-1028.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0</td>\n",
       "      <td>105705.000</td>\n",
       "      <td>0.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>28</th>\n",
       "      <td>100009</td>\n",
       "      <td>5651008</td>\n",
       "      <td>-1259</td>\n",
       "      <td>0</td>\n",
       "      <td>-1080.0</td>\n",
       "      <td>-986.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0</td>\n",
       "      <td>114799.500</td>\n",
       "      <td>NaN</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>29</th>\n",
       "      <td>100009</td>\n",
       "      <td>5651014</td>\n",
       "      <td>-727</td>\n",
       "      <td>0</td>\n",
       "      <td>-482.0</td>\n",
       "      <td>-482.0</td>\n",
       "      <td>0.000</td>\n",
       "      <td>0</td>\n",
       "      <td>110655.000</td>\n",
       "      <td>0.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.000</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>20 rows × 39 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "    SK_ID_CURR  SK_ID_BUREAU  DAYS_CREDIT  CREDIT_DAY_OVERDUE  \\\n",
       "7       100002       6158909         -103                   0   \n",
       "8       100002       6158908         -645                   0   \n",
       "9       100002       6158907        -1121                   0   \n",
       "10      100002       6158906        -1437                   0   \n",
       "11      100002       6158905         -476                   0   \n",
       "12      100002       6158904        -1125                   0   \n",
       "13      100002       6158903        -1042                   0   \n",
       "14      100002       6113835        -1043                   0   \n",
       "15      100003       5885880         -606                   0   \n",
       "16      100003       5885879         -775                   0   \n",
       "17      100003       5885878        -1636                   0   \n",
       "18      100003       5885877        -2586                   0   \n",
       "19      100004       6829133        -1326                   0   \n",
       "20      100004       6829134         -408                   0   \n",
       "24      100007       5987200        -1149                   0   \n",
       "25      100008       6491434          -78                   0   \n",
       "26      100008       6491432        -1097                   0   \n",
       "27      100008       6491433        -1097                   0   \n",
       "28      100009       5651008        -1259                   0   \n",
       "29      100009       5651014         -727                   0   \n",
       "\n",
       "    DAYS_CREDIT_ENDDATE  DAYS_ENDDATE_FACT  AMT_CREDIT_MAX_OVERDUE  \\\n",
       "7                   NaN                NaN                  40.500   \n",
       "8                  85.0              -36.0                5043.645   \n",
       "9                -911.0             -911.0                3321.000   \n",
       "10              -1072.0            -1185.0                   0.000   \n",
       "11                  NaN              -48.0                     NaN   \n",
       "12              -1038.0            -1038.0                     NaN   \n",
       "13                780.0                NaN                     NaN   \n",
       "14                 62.0             -967.0                   0.000   \n",
       "15               1216.0                NaN                   0.000   \n",
       "16               -420.0             -621.0                   0.000   \n",
       "17               -540.0             -540.0                   0.000   \n",
       "18              -2434.0            -2131.0                   0.000   \n",
       "19               -595.0             -683.0                     NaN   \n",
       "20               -382.0             -382.0                   0.000   \n",
       "24               -783.0             -783.0                   0.000   \n",
       "25                471.0                NaN                   0.000   \n",
       "26               -792.0             -790.0                     NaN   \n",
       "27               -853.0            -1028.0                     NaN   \n",
       "28              -1080.0             -986.0                     NaN   \n",
       "29               -482.0             -482.0                   0.000   \n",
       "\n",
       "    CNT_CREDIT_PROLONG  AMT_CREDIT_SUM  AMT_CREDIT_SUM_DEBT     ...       \\\n",
       "7                    0       31988.565                  0.0     ...        \n",
       "8                    0      120735.000                  0.0     ...        \n",
       "9                    0       19071.000                  NaN     ...        \n",
       "10                   0      135000.000                  0.0     ...        \n",
       "11                   0           0.000                  0.0     ...        \n",
       "12                   0       40761.000                  NaN     ...        \n",
       "13                   0      450000.000             245781.0     ...        \n",
       "14                   0       67500.000                  NaN     ...        \n",
       "15                   0      810000.000                  0.0     ...        \n",
       "16                   0       72652.500                  0.0     ...        \n",
       "17                   0      112500.000                  0.0     ...        \n",
       "18                   0       22248.000                  0.0     ...        \n",
       "19                   0       94500.000                  0.0     ...        \n",
       "20                   0       94537.800                  0.0     ...        \n",
       "24                   0      146250.000                  0.0     ...        \n",
       "25                   0      267606.000             240057.0     ...        \n",
       "26                   0       95134.500                  0.0     ...        \n",
       "27                   0      105705.000                  0.0     ...        \n",
       "28                   0      114799.500                  NaN     ...        \n",
       "29                   0      110655.000                  0.0     ...        \n",
       "\n",
       "    CREDIT_TYPE_Loan-for-purchase-of-shares-(margin-lending)  \\\n",
       "7                                                   0          \n",
       "8                                                   0          \n",
       "9                                                   0          \n",
       "10                                                  0          \n",
       "11                                                  0          \n",
       "12                                                  0          \n",
       "13                                                  0          \n",
       "14                                                  0          \n",
       "15                                                  0          \n",
       "16                                                  0          \n",
       "17                                                  0          \n",
       "18                                                  0          \n",
       "19                                                  0          \n",
       "20                                                  0          \n",
       "24                                                  0          \n",
       "25                                                  0          \n",
       "26                                                  0          \n",
       "27                                                  0          \n",
       "28                                                  0          \n",
       "29                                                  0          \n",
       "\n",
       "    CREDIT_TYPE_Loan-for-the-purchase-of-equipment  \\\n",
       "7                                                0   \n",
       "8                                                0   \n",
       "9                                                0   \n",
       "10                                               0   \n",
       "11                                               0   \n",
       "12                                               0   \n",
       "13                                               0   \n",
       "14                                               0   \n",
       "15                                               0   \n",
       "16                                               0   \n",
       "17                                               0   \n",
       "18                                               0   \n",
       "19                                               0   \n",
       "20                                               0   \n",
       "24                                               0   \n",
       "25                                               0   \n",
       "26                                               0   \n",
       "27                                               0   \n",
       "28                                               0   \n",
       "29                                               0   \n",
       "\n",
       "    CREDIT_TYPE_Loan-for-working-capital-replenishment  CREDIT_TYPE_Microloan  \\\n",
       "7                                                   0                       0   \n",
       "8                                                   0                       0   \n",
       "9                                                   0                       0   \n",
       "10                                                  0                       0   \n",
       "11                                                  0                       0   \n",
       "12                                                  0                       0   \n",
       "13                                                  0                       0   \n",
       "14                                                  0                       0   \n",
       "15                                                  0                       0   \n",
       "16                                                  0                       0   \n",
       "17                                                  0                       0   \n",
       "18                                                  0                       0   \n",
       "19                                                  0                       0   \n",
       "20                                                  0                       0   \n",
       "24                                                  0                       0   \n",
       "25                                                  0                       0   \n",
       "26                                                  0                       0   \n",
       "27                                                  0                       0   \n",
       "28                                                  0                       0   \n",
       "29                                                  0                       0   \n",
       "\n",
       "    CREDIT_TYPE_Mobile-operator-loan  CREDIT_TYPE_Mortgage  \\\n",
       "7                                  0                     0   \n",
       "8                                  0                     0   \n",
       "9                                  0                     0   \n",
       "10                                 0                     0   \n",
       "11                                 0                     0   \n",
       "12                                 0                     0   \n",
       "13                                 0                     0   \n",
       "14                                 0                     0   \n",
       "15                                 0                     0   \n",
       "16                                 0                     0   \n",
       "17                                 0                     0   \n",
       "18                                 0                     0   \n",
       "19                                 0                     0   \n",
       "20                                 0                     0   \n",
       "24                                 0                     0   \n",
       "25                                 0                     0   \n",
       "26                                 0                     0   \n",
       "27                                 0                     0   \n",
       "28                                 0                     0   \n",
       "29                                 0                     0   \n",
       "\n",
       "    CREDIT_TYPE_Real-estate-loan  CREDIT_TYPE_Unknown-type-of-loan  TARGET  \\\n",
       "7                              0                                 0     1.0   \n",
       "8                              0                                 0     1.0   \n",
       "9                              0                                 0     1.0   \n",
       "10                             0                                 0     1.0   \n",
       "11                             0                                 0     1.0   \n",
       "12                             0                                 0     1.0   \n",
       "13                             0                                 0     1.0   \n",
       "14                             0                                 0     1.0   \n",
       "15                             0                                 0     0.0   \n",
       "16                             0                                 0     0.0   \n",
       "17                             0                                 0     0.0   \n",
       "18                             0                                 0     0.0   \n",
       "19                             0                                 0     0.0   \n",
       "20                             0                                 0     0.0   \n",
       "24                             0                                 0     0.0   \n",
       "25                             0                                 0     0.0   \n",
       "26                             0                                 0     0.0   \n",
       "27                             0                                 0     0.0   \n",
       "28                             0                                 0     0.0   \n",
       "29                             0                                 0     0.0   \n",
       "\n",
       "    TARGET_norm  \n",
       "7         0.125  \n",
       "8         0.125  \n",
       "9         0.125  \n",
       "10        0.125  \n",
       "11        0.125  \n",
       "12        0.125  \n",
       "13        0.125  \n",
       "14        0.125  \n",
       "15        0.000  \n",
       "16        0.000  \n",
       "17        0.000  \n",
       "18        0.000  \n",
       "19        0.000  \n",
       "20        0.000  \n",
       "24        0.000  \n",
       "25        0.000  \n",
       "26        0.000  \n",
       "27        0.000  \n",
       "28        0.000  \n",
       "29        0.000  \n",
       "\n",
       "[20 rows x 39 columns]"
      ]
     },
     "execution_count": 19,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "bureau.head(20)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "metadata": {},
   "outputs": [],
   "source": [
    "X = bureau.iloc[:, 2:-2]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "metadata": {},
   "outputs": [],
   "source": [
    "y = bureau.iloc[:, -2:]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 30,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "DAYS_CREDIT                                                       0\n",
       "CREDIT_DAY_OVERDUE                                                0\n",
       "DAYS_CREDIT_ENDDATE                                           89098\n",
       "DAYS_ENDDATE_FACT                                            544673\n",
       "AMT_CREDIT_MAX_OVERDUE                                       948545\n",
       "CNT_CREDIT_PROLONG                                                0\n",
       "AMT_CREDIT_SUM                                                    3\n",
       "AMT_CREDIT_SUM_DEBT                                          223094\n",
       "AMT_CREDIT_SUM_LIMIT                                         489670\n",
       "AMT_CREDIT_SUM_OVERDUE                                            0\n",
       "DAYS_CREDIT_UPDATE                                                0\n",
       "AMT_ANNUITY                                                 1130013\n",
       "CREDIT_ACTIVE_Active                                              0\n",
       "CREDIT_ACTIVE_Bad-debt                                            0\n",
       "CREDIT_ACTIVE_Closed                                              0\n",
       "CREDIT_ACTIVE_Sold                                                0\n",
       "CREDIT_CURRENCY_currency-1                                        0\n",
       "CREDIT_CURRENCY_currency-2                                        0\n",
       "CREDIT_CURRENCY_currency-3                                        0\n",
       "CREDIT_CURRENCY_currency-4                                        0\n",
       "CREDIT_TYPE_Another-type-of-loan                                  0\n",
       "CREDIT_TYPE_Car-loan                                              0\n",
       "CREDIT_TYPE_Cash-loan-(non-earmarked)                             0\n",
       "CREDIT_TYPE_Consumer-credit                                       0\n",
       "CREDIT_TYPE_Credit-card                                           0\n",
       "CREDIT_TYPE_Interbank-credit                                      0\n",
       "CREDIT_TYPE_Loan-for-business-development                         0\n",
       "CREDIT_TYPE_Loan-for-purchase-of-shares-(margin-lending)          0\n",
       "CREDIT_TYPE_Loan-for-the-purchase-of-equipment                    0\n",
       "CREDIT_TYPE_Loan-for-working-capital-replenishment                0\n",
       "CREDIT_TYPE_Microloan                                             0\n",
       "CREDIT_TYPE_Mobile-operator-loan                                  0\n",
       "CREDIT_TYPE_Mortgage                                              0\n",
       "CREDIT_TYPE_Real-estate-loan                                      0\n",
       "CREDIT_TYPE_Unknown-type-of-loan                                  0\n",
       "dtype: int64"
      ]
     },
     "execution_count": 30,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "X.isnull().sum()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 31,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "DAYS_CREDIT                                                   -2922.000\n",
       "CREDIT_DAY_OVERDUE                                                0.000\n",
       "DAYS_CREDIT_ENDDATE                                          -42060.000\n",
       "DAYS_ENDDATE_FACT                                            -42023.000\n",
       "AMT_CREDIT_MAX_OVERDUE                                            0.000\n",
       "CNT_CREDIT_PROLONG                                                0.000\n",
       "AMT_CREDIT_SUM                                                    0.000\n",
       "AMT_CREDIT_SUM_DEBT                                        -4705600.320\n",
       "AMT_CREDIT_SUM_LIMIT                                        -586406.115\n",
       "AMT_CREDIT_SUM_OVERDUE                                            0.000\n",
       "DAYS_CREDIT_UPDATE                                           -41947.000\n",
       "AMT_ANNUITY                                                       0.000\n",
       "CREDIT_ACTIVE_Active                                              0.000\n",
       "CREDIT_ACTIVE_Bad-debt                                            0.000\n",
       "CREDIT_ACTIVE_Closed                                              0.000\n",
       "CREDIT_ACTIVE_Sold                                                0.000\n",
       "CREDIT_CURRENCY_currency-1                                        0.000\n",
       "CREDIT_CURRENCY_currency-2                                        0.000\n",
       "CREDIT_CURRENCY_currency-3                                        0.000\n",
       "CREDIT_CURRENCY_currency-4                                        0.000\n",
       "CREDIT_TYPE_Another-type-of-loan                                  0.000\n",
       "CREDIT_TYPE_Car-loan                                              0.000\n",
       "CREDIT_TYPE_Cash-loan-(non-earmarked)                             0.000\n",
       "CREDIT_TYPE_Consumer-credit                                       0.000\n",
       "CREDIT_TYPE_Credit-card                                           0.000\n",
       "CREDIT_TYPE_Interbank-credit                                      0.000\n",
       "CREDIT_TYPE_Loan-for-business-development                         0.000\n",
       "CREDIT_TYPE_Loan-for-purchase-of-shares-(margin-lending)          0.000\n",
       "CREDIT_TYPE_Loan-for-the-purchase-of-equipment                    0.000\n",
       "CREDIT_TYPE_Loan-for-working-capital-replenishment                0.000\n",
       "CREDIT_TYPE_Microloan                                             0.000\n",
       "CREDIT_TYPE_Mobile-operator-loan                                  0.000\n",
       "CREDIT_TYPE_Mortgage                                              0.000\n",
       "CREDIT_TYPE_Real-estate-loan                                      0.000\n",
       "CREDIT_TYPE_Unknown-type-of-loan                                  0.000\n",
       "dtype: float64"
      ]
     },
     "execution_count": 31,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "X.min()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 33,
   "metadata": {},
   "outputs": [],
   "source": [
    "X.fillna(0, inplace=True)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# GP"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "function_set = ['add' , 'sub', 'mul', 'div', 'sqrt', 'log', 'abs', 'neg', 'inv', 'max', 'min', 'sin', 'cos', 'tan']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 28,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "gp = SymbolicTransformer(\n",
    "    population_size=1000, \n",
    "    hall_of_fame=100, \n",
    "    n_components=10, \n",
    "    generations=20, \n",
    "    tournament_size=20, \n",
    "    stopping_criteria=1.0, \n",
    "    const_range=(-1.0, 1.0), \n",
    "    init_depth=(2, 6), \n",
    "    init_method='half and half', \n",
    "    function_set=function_set,\n",
    "    metric='pearson', \n",
    "    parsimony_coefficient=0.001, \n",
    "    p_crossover=0.9, \n",
    "    p_subtree_mutation=0.01, \n",
    "    p_hoist_mutation=0.01, \n",
    "    p_point_mutation=0.01, \n",
    "    p_point_replace=0.05, \n",
    "    max_samples=0.7, \n",
    "    warm_start=False, \n",
    "    n_jobs=cpu_count(), \n",
    "    verbose=1, \n",
    "    random_state=0)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 34,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "    |    Population Average   |             Best Individual              |\n",
      "---- ------------------------- ------------------------------------------ ----------\n",
      " Gen   Length          Fitness   Length          Fitness      OOB Fitness  Time Left\n",
      "   0     8.54 0.010008250169361134        4 0.07158444881847875 0.06825691485958775     12.97m\n",
      "   1     4.58 0.038508388462836746        4 0.07193116675837924 0.0674576297055329     11.84m\n",
      "   2     3.29 0.06171393989616202        2 0.07186121312336928 0.06761670166423671     11.11m\n",
      "   3     2.07 0.06929441319357964        2 0.07270286364062829 0.06565769434097406     10.53m\n",
      "   4     1.99 0.06925803316892572        2 0.07230073282575694 0.0666060206270237      9.90m\n",
      "   5     2.02 0.06891766753666531        2 0.07228629752413965 0.06663497647192926      9.26m\n",
      "   6     2.04 0.06915501143314191        2 0.0722730570880859 0.06666979347418629      8.60m\n",
      "   7     2.04 0.06922596306152821        2 0.07233445372520061 0.06653402627011701      7.96m\n",
      "   8     2.01 0.06895198809054387        2 0.07246445478567116 0.06622761683217158      7.31m\n",
      "   9     1.99 0.06931587527990118        2 0.07227549619515959 0.06661519503949427      6.65m\n",
      "  10     2.01 0.06909710120447546        2 0.07260316821052282 0.06591861326473412      5.99m\n",
      "  11     2.03 0.06922645876057283        2 0.07234947902079818 0.06650147117955447      5.33m\n",
      "  12      2.0 0.0691296885311499        2 0.072667430812984 0.06577098421722102      4.67m\n",
      "  13     2.02 0.06931119633806185        2 0.0723515930831728 0.06648279129603214      4.00m\n",
      "  14     2.07 0.06940021418074759        2 0.07263273947437825 0.06582291815800906      3.34m\n",
      "  15      2.0 0.06906629071476891        2 0.07257654766649789 0.0659813447683177      2.67m\n",
      "  16     2.02 0.0694484245912199        2 0.07241561793583312 0.06635408565782698      2.00m\n",
      "  17     2.02 0.0692770292173487        2 0.07257559414738801 0.0659251664360506      1.34m\n",
      "  18     2.02 0.06923486387219958        2 0.07256307853298424 0.06598267710120008     40.11s\n",
      "  19     2.05 0.06891115342008151        2 0.0722540435565962 0.06671102235500108      0.00s\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "SymbolicTransformer(const_range=(-1.0, 1.0),\n",
       "          function_set=['add', 'sub', 'mul', 'div', 'sqrt', 'log', 'abs', 'neg', 'inv', 'max', 'min', 'sin', 'cos', 'tan'],\n",
       "          generations=20, hall_of_fame=100, init_depth=(2, 6),\n",
       "          init_method='half and half', max_samples=0.7, metric='pearson',\n",
       "          n_components=10, n_jobs=32, p_crossover=0.9,\n",
       "          p_hoist_mutation=0.01, p_point_mutation=0.01,\n",
       "          p_point_replace=0.05, p_subtree_mutation=0.01,\n",
       "          parsimony_coefficient=0.001, population_size=1000,\n",
       "          random_state=0, stopping_criteria=1.0, tournament_size=20,\n",
       "          verbose=1, warm_start=False)"
      ]
     },
     "execution_count": 34,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "gp.fit(X, y.TARGET)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 35,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[log(X0),\n",
      " log(X0),\n",
      " log(X0),\n",
      " log(X0),\n",
      " log(X0),\n",
      " log(X0),\n",
      " log(X0),\n",
      " log(X0),\n",
      " log(X0),\n",
      " log(X0)]\n"
     ]
    }
   ],
   "source": [
    "print(gp)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 36,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "gp2 = SymbolicTransformer(\n",
    "    population_size=1000, \n",
    "    hall_of_fame=100, \n",
    "    n_components=10, \n",
    "    generations=20, \n",
    "    tournament_size=20, \n",
    "    stopping_criteria=1.0, \n",
    "    const_range=(-22.0, 22.0), \n",
    "    init_depth=(2, 6), \n",
    "    init_method='half and half', \n",
    "    function_set=function_set,\n",
    "    metric='pearson', \n",
    "    parsimony_coefficient=0.001, \n",
    "    p_crossover=0.9, \n",
    "    p_subtree_mutation=0.01, \n",
    "    p_hoist_mutation=0.01, \n",
    "    p_point_mutation=0.01, \n",
    "    p_point_replace=0.05, \n",
    "    max_samples=0.7, \n",
    "    warm_start=False, \n",
    "    n_jobs=40, \n",
    "    verbose=1, \n",
    "    random_state=0)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 37,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "    |    Population Average   |             Best Individual              |\n",
      "---- ------------------------- ------------------------------------------ ----------\n",
      " Gen   Length          Fitness   Length          Fitness      OOB Fitness  Time Left\n",
      "   0     8.54 0.009822300986174134        4 0.07405031412349687 0.07139377962254552     14.28m\n",
      "   1     4.95 0.04093469086506655        4 0.07436212001051754 0.07067384742843744     13.34m\n",
      "   2     3.61 0.062025175972254626        8 0.07572350425660948 0.07459445664129047     12.58m\n",
      "   3     2.13 0.0715324705213225        2 0.07505454626148735 0.06907467376049341     11.94m\n",
      "   4     1.99 0.07153708730075141        2 0.07583995037827547 0.06719782786297064     11.21m\n",
      "   5     2.02 0.07123636472336094        2 0.07564501542697748 0.06762429443795089     10.49m\n",
      "   6     2.04 0.07147571240330587        2 0.07533798337366163 0.0683873063839544      9.74m\n",
      "   7     2.04 0.07151855246736351        2 0.07557880943229812 0.0678608935568286      9.00m\n",
      "   8     2.01 0.07123998333058988        2 0.07558041500020587 0.06793439196048225      8.27m\n",
      "   9     1.99 0.07157163376819022        2 0.0752588137008586 0.06856111427153413      7.51m\n",
      "  10     2.01 0.07132908284761456        2 0.07518240509903894 0.0687090263833847      6.76m\n",
      "  11     2.03 0.07152521345548742        2 0.07548024888713076 0.068093553520953      6.01m\n",
      "  12      2.0 0.07139536844630132        2 0.07509770475568021 0.06899262017939509      5.26m\n",
      "  13     2.02 0.07162834956912081        2 0.07519981800972572 0.06877691262949942      4.51m\n",
      "  14     2.07 0.07169580753756742        2 0.07543099246231565 0.06811629262090067      3.76m\n",
      "  15      2.0 0.07131368505756815        2 0.07510044873935637 0.06895603591059862      3.01m\n",
      "  16     2.02 0.07180646312867585        2 0.07528132238045154 0.06851864752735182      2.26m\n",
      "  17     2.02 0.07163749863292121        2 0.07543049026505472 0.06827554547986651      1.51m\n",
      "  18     2.02 0.07153233446174002        2 0.07525967060028517 0.06869338772077423     45.13s\n",
      "  19     2.05 0.07120023123778178        2 0.07513795994848092 0.06882041261330789      0.00s\n",
      "[log(X0),\n",
      " log(log(X0)),\n",
      " log(log(X0)),\n",
      " log(log(X0)),\n",
      " log(log(X0)),\n",
      " log(X0),\n",
      " log(X0),\n",
      " log(X0),\n",
      " log(X0),\n",
      " log(X0)]\n"
     ]
    }
   ],
   "source": [
    "gp2.fit(X, y.TARGET_norm)\n",
    "print(gp2)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.4"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
